package com.gitee.shigen.sample.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.baomidou.mybatisplus.annotation.*;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * @author shigenfu
 * @date 2023/2/25 10:25 下午
 */
@Schema(title = "user", description = "用户信息表")
@Data
@TableName(value = "sys_user")
public class User implements Serializable {

    @NotNull(message = "[]不能为空")
    @Schema(title = "")
    @TableId(type = IdType.AUTO)
    private Long          id;

    @NotBlank(message = "[]不能为空")
    @Schema(title = "username")
    @Length(max = 255, message = "编码长度不能超过{max}")
    private String        username;

    @Schema(title = "password")
    @Length(max = 255, message = "编码长度不能超过{max}")
    private String        password;

    @Schema(title = "昵称")
    private String        nickname;

    @Schema(name = "电话")
    private String        phone;

    @Schema(title = "用户个人介绍")
    @Length(max = 200, message = "编码长度不能超过{max}")
    private String        introduction;

    @Schema(title = "用户头像地址")
    @Length(max = 300, message = "编码长度不能超过{max}")
    private String        avatar;

    @Schema(title = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(title = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @Schema(title = "是否删除")
    private Integer       status;
}
